import { Controller } from '@nestjs/common';
import { Crud } from '@nestjsx/crud';
import { Bulletin } from "../../entities/bulletin.entities";
import { BulletinService } from "../../services/bulletin/bulletin.service";
import { ApiTags} from '@nestjs/swagger';

@ApiTags('bulletin')
@Crud({
  model:{
    type:Bulletin
  },
  query:{
    exclude:["sort","enabled"],
    sort:[
      {
        field:"sort",
        order:"ASC"
      }
    ],
    filter:[
      {
        field:"enabled",
        operator:"$eq",
        value:1
      }
    ]
  }
})
@Controller('api/bulletin')
export class BulletinController {
  constructor(
    public service:BulletinService
  ){}
}
